<?php
/* @var $this ShopSliderController */
/* @var $model ShopSlider */
/* @var $form CActiveForm */
?>

<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'shop-slider-_shopslider-form',
        // Please note: When you enable ajax validation, make sure the corresponding
        // controller action is handling ajax validation correctly.
        // See class documentation of CActiveForm for details on this,
        // you need to use the performAjaxValidation()-method described there.
        'enableAjaxValidation' => false,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
    ));
    ?>



    <?php echo $form->errorSummary($model); ?>


    <div class="form_left">
        <?php echo $form->labelEx($model, 'title'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'title', array('size' => 60, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'title'); ?>
    </div>

    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'url'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'url', array('size' => 60, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'url'); ?>
    </div>

    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'photo'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->fileField($model, 'photo', array('size' => 40, 'maxlength' => 50)); ?>
        <?php echo $form->error($model, 'photo'); ?>
    </div>

    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'dateExpend'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'dateExpend', array('class' => 'easyui-datebox', 'data-options' => 'formatter:myformatter,parser:myparser')); ?>
        <?php echo $form->error($model, 'dateExpend'); ?>
    </div>


    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'small_content'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'small_content', array('style' => 'width: 400px; height: 100px;', 'maxlength' => 300, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'small_content'); ?>
    </div>

    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'position'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'position', array('class' => 'easyui-numberspinner', 'style' => 'width:80px;')); ?>
        <?php echo $form->error($model, 'position'); ?>
    </div>

    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'shopid'); ?>
    </div>
    <div class="form_right">
        <?php
        $session = new CHttpSession;
        $session->open();
        $userID = $session['user_salesmart'][3];

        $listshop = Shop::model()->findAll('flag in(1,4) and uid=' . $userID);

        $list = CHtml::listData($listshop, 'id', 'shopName');

        echo $form->dropDownList($model, 'shopid', $list);
        ?>
        <?php echo $form->error($model, 'shopid'); ?>
    </div>

    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'type'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->dropDownList($model, 'type', array('0' => 'Quảng cáo tin tức', '1' => 'Quảng cáo video')); ?>
        <?php echo $form->error($model, 'type'); ?>
    </div>

    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'flag'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->dropDownList($model, 'flag', array('0' => 'Đang ẩn', '1' => 'Đang hiện')); ?>
        <?php echo $form->error($model, 'flag'); ?>
    </div>

    <div class="clear"></div>
    <div class="form_left">.</div>
    <div class="form_right">
        <?php echo CHtml::submitButton('Cập nhật'); ?>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->
